import { http } from '@/utils/http'
import type { HomeBannerType } from '../types/homeType'
import type { CategoryItem } from '../types/homeType'
import type { HotMutliItem } from '../types/homeType'
import type { GoodsItem, PageResult } from '@/types/global'
import type { PageParams } from '@/types/global'
import type { GuessLikesItem } from '@/types/homeType'
import type { HotResult } from '@/types/hotType'

export const getHomeBannerApi = (distrbutionSite = 1) => {
  return http<HomeBannerType[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distrbutionSite,
    },
  })
}
/**
 *
 * 首页——前台分类小程序
 */
export const getCategoryApi = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
/**
 * 首页——特惠推荐
*/
export const getHotMutli = () => {
  return http<HotMutliItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
/**
 * 猜你喜欢
*/
export const getGuessYouLikeApi = (data?: PageParams) => {
  return http<PageResult<GoodsItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
